﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
      <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.loadmask.css" rel="stylesheet" type="text/css" />
    <script src="../Js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../Js/ligerui.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="../Js/jquery.loadmask.min.js" type="text/javascript"></script>
    <script src="../Js/json2.js" type="text/javascript"></script>
    <script src="../Js/conmon.js" type="text/javascript"></script>
    <script type="text/javascript">
        var Row = null;
        var pWind = null;
        $(function () {
            $("#form1").ligerForm();
            //$selectRow
            pWind = parent.window.parent.window.getWindow();
            Row = (pWind != null ? pWind.$UpdateItemRole : null);
            if (Row != null) {
                $("#txtRole").ligerComboBox({ width: 140, slide: false, data: null });
                $.getJSON('../WebServer/EmpManage.ashx?Action=GetTheDepartmentListJson2', { areaid: Row.aid, Rnd: Math.random() }, function (data) {
                    $("#txtRole").ligerComboBox().setData(data);
                    $("#txtRole").ligerComboBox().selectValue(Row.rid);

                });
                //赋值
                $("#lbName").text(Row.name);
                //

            }

            //保存
            $("#btnSave").click(function () {
                if (chk()) {
                    if (Row) {
                        Row.rid = $("#txtRole_val").val();
                        var pars = { id: Row.id, aid: Row.aid, jid: Row.jid, rid: Row.rid };
                        $("body").mask("数据处理中，请稍候......");
                        $.post('../WebServer/EmpManage.ashx?Action=UpUserRole', pars, function (data) {
                            $("body").unmask();
                            var rdata = eval("(" + data + ")");
                            if (rdata.IsSuccess == 1) {
                                showAlertOk("修改成功");
                                if (pWind) pWind.loadGrid();
                            } else {
                                showErrorTip(rdata.Msg);
                            }
                        });
                    } //end row
                } //end chk
            });
            $("#btnCancel").click(function () { closeRefresh(false, ""); });

        });


        function chk() {
            var err = "";


            if ($.trim($("#txtRole").val()) == "") {
                err = "请选择职务!";
                showErrorTip(err);
                return false;
            }

            return true;
        }
      
    </script>

     <style type="text/css">
        .edittable td.editcellmessage,.edittable td.editcellverify,.edittable td.editcell{ padding:5px;line-height:25px;}
        .edittable td.editcellmessage{ padding-left:20px;} 
        body { font-size:12px; background:white;}
         
    </style>
</head>
<body>
<form id="from1" action="">
     <table cellpadding="0" border="0" cellspacing="0" class="edittable">
        <tr>
         <td  class="editcellmessage">用户名:</td>
         <td><label id="lbName"></label></td>
        </tr>
        
           <tr>
           <td  class="editcellmessage">职务:</td>
           <td><input id="txtRole" name="txtRole" type="text" ltype="text" /></td>
        </tr>
       
      
   </table>
       <div class="buttonpanel">
             <div style="float:right;margin-right:10px;">
                 <a id="btnSave" class="button" href="javascript:void(0);"><span>保存</span></a>
                 <a id="btnCancel" class="button" href="javascript:void(0);"><span>关闭</span></a>
              </div>
      </div>
   </form>
</body>
</html>
